<!--
  使用示例
  @setProvince：将省份id传递给父组件
  @setCity：将城市id传递给父组件
  :province：传递给组件初始省份id
  :city：传递给组件初始城市id
  <area-choose
    @setProvince="ruleForm.provinceId = arguments[0]"
    @setCity="ruleForm.cityId = arguments[0]"
    :province="ruleForm.provinceId"
    :city="ruleForm.cityId">
  </area-choose>
-->
<template>
  <el-row>
    <el-col :span="11">
      <el-select @change="changeProvince" v-model="currProvince">
        <el-option
          label="请选择"
          value="0">
        </el-option>
        <el-option
          v-for="item in provinces"
          :label="item.name"
          :value="item.id">
        </el-option>
      </el-select>
    </el-col>
    <el-col :span="11" :offset="2">
      <el-select @change="changeCity" v-model="currCity">
        <el-option
          label="请选择"
          value="0">
        </el-option>
        <el-option
          v-for="item in citys"
          :label="item.name"
          :value="item.id">
        </el-option>
      </el-select>
    </el-col>
  </el-row>
</template>

<script type="es6">
export default {
  name: 'area-choose',
  props: {
    province: [String, Number],
    city: [String, Number],
  },
  data() {
    this.areas = [{
      id: 2,
      name: '北京',
      parent_id: 0
    }, {
      id: 3,
      name: '天津',
      parent_id: 0
    }, {
      id: 4,
      name: '河北',
      parent_id: 0
    }, {
      id: 5,
      name: '山西',
      parent_id: 0
    }, {
      id: 6,
      name: '内蒙古',
      parent_id: 0
    }, {
      id: 7,
      name: '辽宁',
      parent_id: 0
    }, {
      id: 8,
      name: '吉林',
      parent_id: 0
    }, {
      id: 9,
      name: '黑龙江',
      parent_id: 0
    }, {
      id: 10,
      name: '上海',
      parent_id: 0
    }, {
      id: 11,
      name: '江苏',
      parent_id: 0
    }, {
      id: 12,
      name: '浙江',
      parent_id: 0
    }, {
      id: 13,
      name: '安徽',
      parent_id: 0
    }, {
      id: 14,
      name: '福建',
      parent_id: 0
    }, {
      id: 15,
      name: '江西',
      parent_id: 0
    }, {
      id: 16,
      name: '山东',
      parent_id: 0
    }, {
      id: 17,
      name: '河南',
      parent_id: 0
    }, {
      id: 18,
      name: '湖北',
      parent_id: 0
    }, {
      id: 19,
      name: '湖南',
      parent_id: 0
    }, {
      id: 20,
      name: '广东',
      parent_id: 0
    }, {
      id: 21,
      name: '广西',
      parent_id: 0
    }, {
      id: 22,
      name: '海南',
      parent_id: 0
    }, {
      id: 23,
      name: '重庆',
      parent_id: 0
    }, {
      id: 24,
      name: '四川',
      parent_id: 0
    }, {
      id: 25,
      name: '贵州',
      parent_id: 0
    }, {
      id: 26,
      name: '云南',
      parent_id: 0
    }, {
      id: 27,
      name: '西藏',
      parent_id: 0
    }, {
      id: 28,
      name: '陕西',
      parent_id: 0
    }, {
      id: 29,
      name: '甘肃',
      parent_id: 0
    }, {
      id: 30,
      name: '青海',
      parent_id: 0
    }, {
      id: 31,
      name: '宁夏',
      parent_id: 0
    }, {
      id: 32,
      name: '新疆',
      parent_id: 0
    }, {
      id: 33,
      name: '台湾',
      parent_id: 0
    }, {
      id: 34,
      name: '香港',
      parent_id: 0
    }, {
      id: 35,
      name: '澳门',
      parent_id: 0
    }, {
      id: 36,
      name: '亚洲其他国家',
      parent_id: 0
    }, {
      id: 37,
      name: '欧洲国家',
      parent_id: 0
    }, {
      id: 38,
      name: '美洲国家',
      parent_id: 0
    }, {
      id: 39,
      name: '大洋州国家',
      parent_id: 0
    }, {
      id: 41,
      name: '东城区',
      parent_id: 2
    }, {
      id: 42,
      name: '西城区',
      parent_id: 2
    }, {
      id: 43,
      name: '宣武区',
      parent_id: 2
    }, {
      id: 44,
      name: '朝阳区',
      parent_id: 2
    }, {
      id: 45,
      name: '海淀区',
      parent_id: 2
    }, {
      id: 46,
      name: '丰台区',
      parent_id: 2
    }, {
      id: 47,
      name: '石景山',
      parent_id: 2
    }, {
      id: 48,
      name: '门头沟',
      parent_id: 2
    }, {
      id: 49,
      name: '房山区',
      parent_id: 2
    }, {
      id: 50,
      name: '通州区',
      parent_id: 2
    }, {
      id: 51,
      name: '顺义区',
      parent_id: 2
    }, {
      id: 52,
      name: '昌平区',
      parent_id: 2
    }, {
      id: 53,
      name: '大兴区',
      parent_id: 2
    }, {
      id: 54,
      name: '怀柔区',
      parent_id: 2
    }, {
      id: 55,
      name: '延庆县',
      parent_id: 2
    }, {
      id: 56,
      name: '平谷区',
      parent_id: 2
    }, {
      id: 57,
      name: '密云县',
      parent_id: 2
    }, {
      id: 58,
      name: '滨海',
      parent_id: 3
    }, {
      id: 59,
      name: '和平',
      parent_id: 3
    }, {
      id: 60,
      name: '河北',
      parent_id: 3
    }, {
      id: 61,
      name: '河西',
      parent_id: 3
    }, {
      id: 62,
      name: '河东',
      parent_id: 3
    }, {
      id: 63,
      name: '南开',
      parent_id: 3
    }, {
      id: 64,
      name: '红桥',
      parent_id: 3
    }, {
      id: 65,
      name: '塘沽',
      parent_id: 3
    }, {
      id: 66,
      name: '大港',
      parent_id: 3
    }, {
      id: 67,
      name: '东丽',
      parent_id: 3
    }, {
      id: 68,
      name: '西青',
      parent_id: 3
    }, {
      id: 69,
      name: '津南',
      parent_id: 3
    }, {
      id: 70,
      name: '北辰',
      parent_id: 3
    }, {
      id: 71,
      name: '武清',
      parent_id: 3
    }, {
      id: 72,
      name: '宝坻',
      parent_id: 3
    }, {
      id: 73,
      name: '蓟县',
      parent_id: 3
    }, {
      id: 74,
      name: '静海',
      parent_id: 3
    }, {
      id: 75,
      name: '宁河',
      parent_id: 3
    }, {
      id: 76,
      name: '石家庄',
      parent_id: 4
    }, {
      id: 77,
      name: '唐山',
      parent_id: 4
    }, {
      id: 78,
      name: '秦皇岛',
      parent_id: 4
    }, {
      id: 79,
      name: '邯郸',
      parent_id: 4
    }, {
      id: 80,
      name: '邢台',
      parent_id: 4
    }, {
      id: 81,
      name: '保定',
      parent_id: 4
    }, {
      id: 82,
      name: '张家口',
      parent_id: 4
    }, {
      id: 83,
      name: '承德',
      parent_id: 4
    }, {
      id: 84,
      name: '沧州',
      parent_id: 4
    }, {
      id: 85,
      name: '廊坊',
      parent_id: 4
    }, {
      id: 86,
      name: '衡水',
      parent_id: 4
    }, {
      id: 87,
      name: '其它',
      parent_id: 4
    }, {
      id: 88,
      name: '太原',
      parent_id: 5
    }, {
      id: 89,
      name: '大同',
      parent_id: 5
    }, {
      id: 90,
      name: '阳泉',
      parent_id: 5
    }, {
      id: 91,
      name: '长治',
      parent_id: 5
    }, {
      id: 92,
      name: '晋城',
      parent_id: 5
    }, {
      id: 93,
      name: '朔州',
      parent_id: 5
    }, {
      id: 94,
      name: '晋中',
      parent_id: 5
    }, {
      id: 95,
      name: '运城',
      parent_id: 5
    }, {
      id: 96,
      name: '忻州',
      parent_id: 5
    }, {
      id: 97,
      name: '临汾',
      parent_id: 5
    }, {
      id: 98,
      name: '吕梁',
      parent_id: 5
    }, {
      id: 99,
      name: '其它',
      parent_id: 5
    }, {
      id: 100,
      name: '呼和浩特',
      parent_id: 6
    }, {
      id: 101,
      name: '包头',
      parent_id: 6
    }, {
      id: 102,
      name: '乌海',
      parent_id: 6
    }, {
      id: 103,
      name: '赤峰',
      parent_id: 6
    }, {
      id: 104,
      name: '通辽',
      parent_id: 6
    }, {
      id: 105,
      name: '鄂尔多斯',
      parent_id: 6
    }, {
      id: 106,
      name: '呼伦贝尔',
      parent_id: 6
    }, {
      id: 107,
      name: '巴彦淖尔',
      parent_id: 6
    }, {
      id: 108,
      name: '乌兰察布',
      parent_id: 6
    }, {
      id: 109,
      name: '兴安盟',
      parent_id: 6
    }, {
      id: 110,
      name: '锡林郭勒盟',
      parent_id: 6
    }, {
      id: 111,
      name: '阿拉善盟',
      parent_id: 6
    }, {
      id: 112,
      name: '沈阳',
      parent_id: 7
    }, {
      id: 113,
      name: '大连',
      parent_id: 7
    }, {
      id: 114,
      name: '鞍山',
      parent_id: 7
    }, {
      id: 115,
      name: '抚顺',
      parent_id: 7
    }, {
      id: 116,
      name: '本溪',
      parent_id: 7
    }, {
      id: 117,
      name: '丹东',
      parent_id: 7
    }, {
      id: 118,
      name: '锦州',
      parent_id: 7
    }, {
      id: 119,
      name: '营口',
      parent_id: 7
    }, {
      id: 120,
      name: '阜新',
      parent_id: 7
    }, {
      id: 121,
      name: '辽阳',
      parent_id: 7
    }, {
      id: 122,
      name: '盘锦',
      parent_id: 7
    }, {
      id: 123,
      name: '铁岭',
      parent_id: 7
    }, {
      id: 124,
      name: '朝阳',
      parent_id: 7
    }, {
      id: 125,
      name: '葫芦岛',
      parent_id: 7
    }, {
      id: 126,
      name: '其它',
      parent_id: 7
    }, {
      id: 127,
      name: '长春',
      parent_id: 8
    }, {
      id: 128,
      name: '吉林',
      parent_id: 8
    }, {
      id: 129,
      name: '四平',
      parent_id: 8
    }, {
      id: 130,
      name: '辽源',
      parent_id: 8
    }, {
      id: 131,
      name: '通化',
      parent_id: 8
    }, {
      id: 132,
      name: '白山',
      parent_id: 8
    }, {
      id: 133,
      name: '松原',
      parent_id: 8
    }, {
      id: 134,
      name: '白城',
      parent_id: 8
    }, {
      id: 135,
      name: '延边',
      parent_id: 8
    }, {
      id: 136,
      name: '其它',
      parent_id: 8
    }, {
      id: 137,
      name: '哈尔滨',
      parent_id: 9
    }, {
      id: 138,
      name: '齐齐哈尔',
      parent_id: 9
    }, {
      id: 139,
      name: '鸡西',
      parent_id: 9
    }, {
      id: 140,
      name: '鹤岗',
      parent_id: 9
    }, {
      id: 141,
      name: '双鸭山',
      parent_id: 9
    }, {
      id: 142,
      name: '大庆',
      parent_id: 9
    }, {
      id: 143,
      name: '伊春',
      parent_id: 9
    }, {
      id: 144,
      name: '佳木斯',
      parent_id: 9
    }, {
      id: 145,
      name: '七台河',
      parent_id: 9
    }, {
      id: 146,
      name: '牡丹江',
      parent_id: 9
    }, {
      id: 147,
      name: '黑河',
      parent_id: 9
    }, {
      id: 148,
      name: '绥化',
      parent_id: 9
    }, {
      id: 149,
      name: '大兴安岭',
      parent_id: 9
    }, {
      id: 150,
      name: '其它',
      parent_id: 9
    }, {
      id: 151,
      name: '宝山',
      parent_id: 10
    }, {
      id: 152,
      name: '金山',
      parent_id: 10
    }, {
      id: 153,
      name: '长宁',
      parent_id: 10
    }, {
      id: 154,
      name: '静安',
      parent_id: 10
    }, {
      id: 155,
      name: '青浦',
      parent_id: 10
    }, {
      id: 156,
      name: '卢湾',
      parent_id: 10
    }, {
      id: 157,
      name: '松江',
      parent_id: 10
    }, {
      id: 158,
      name: '奉贤',
      parent_id: 10
    }, {
      id: 159,
      name: '浦东',
      parent_id: 10
    }, {
      id: 160,
      name: '杨浦',
      parent_id: 10
    }, {
      id: 161,
      name: '虹口',
      parent_id: 10
    }, {
      id: 162,
      name: '普陀',
      parent_id: 10
    }, {
      id: 163,
      name: '闸北',
      parent_id: 10
    }, {
      id: 164,
      name: '黄浦',
      parent_id: 10
    }, {
      id: 165,
      name: '闵行',
      parent_id: 10
    }, {
      id: 166,
      name: '徐汇',
      parent_id: 10
    }, {
      id: 167,
      name: '嘉定',
      parent_id: 10
    }, {
      id: 168,
      name: '南汇',
      parent_id: 10
    }, {
      id: 169,
      name: '南京',
      parent_id: 11
    }, {
      id: 170,
      name: '无锡',
      parent_id: 11
    }, {
      id: 171,
      name: '徐州',
      parent_id: 11
    }, {
      id: 172,
      name: '常州',
      parent_id: 11
    }, {
      id: 173,
      name: '苏州',
      parent_id: 11
    }, {
      id: 174,
      name: '南通',
      parent_id: 11
    }, {
      id: 175,
      name: '连云港',
      parent_id: 11
    }, {
      id: 176,
      name: '淮安',
      parent_id: 11
    }, {
      id: 177,
      name: '盐城',
      parent_id: 11
    }, {
      id: 178,
      name: '扬州',
      parent_id: 11
    }, {
      id: 179,
      name: '镇江',
      parent_id: 11
    }, {
      id: 180,
      name: '泰州',
      parent_id: 11
    }, {
      id: 181,
      name: '宿迁',
      parent_id: 11
    }, {
      id: 182,
      name: '其它',
      parent_id: 11
    }, {
      id: 183,
      name: '杭州',
      parent_id: 12
    }, {
      id: 184,
      name: '宁波',
      parent_id: 12
    }, {
      id: 185,
      name: '温州',
      parent_id: 12
    }, {
      id: 186,
      name: '嘉兴',
      parent_id: 12
    }, {
      id: 187,
      name: '湖州',
      parent_id: 12
    }, {
      id: 188,
      name: '绍兴',
      parent_id: 12
    }, {
      id: 189,
      name: '金华',
      parent_id: 12
    }, {
      id: 190,
      name: '衢州',
      parent_id: 12
    }, {
      id: 191,
      name: '舟山',
      parent_id: 12
    }, {
      id: 192,
      name: '台州',
      parent_id: 12
    }, {
      id: 193,
      name: '丽水',
      parent_id: 12
    }, {
      id: 194,
      name: '其它',
      parent_id: 12
    }, {
      id: 195,
      name: '合肥',
      parent_id: 13
    }, {
      id: 196,
      name: '芜湖',
      parent_id: 13
    }, {
      id: 197,
      name: '蚌埠',
      parent_id: 13
    }, {
      id: 198,
      name: '淮南',
      parent_id: 13
    }, {
      id: 199,
      name: '马鞍山',
      parent_id: 13
    }, {
      id: 200,
      name: '淮北',
      parent_id: 13
    }, {
      id: 201,
      name: '铜陵',
      parent_id: 13
    }, {
      id: 202,
      name: '安庆',
      parent_id: 13
    }, {
      id: 203,
      name: '黄山',
      parent_id: 13
    }, {
      id: 204,
      name: '滁州',
      parent_id: 13
    }, {
      id: 205,
      name: '阜阳',
      parent_id: 13
    }, {
      id: 206,
      name: '宿州',
      parent_id: 13
    }, {
      id: 207,
      name: '巢湖',
      parent_id: 13
    }, {
      id: 208,
      name: '六安',
      parent_id: 13
    }, {
      id: 209,
      name: '亳州',
      parent_id: 13
    }, {
      id: 210,
      name: '池州',
      parent_id: 13
    }, {
      id: 211,
      name: '宣城',
      parent_id: 13
    }, {
      id: 212,
      name: '其它',
      parent_id: 13
    }, {
      id: 213,
      name: '福州',
      parent_id: 14
    }, {
      id: 214,
      name: '厦门',
      parent_id: 14
    }, {
      id: 215,
      name: '莆田',
      parent_id: 14
    }, {
      id: 216,
      name: '三明',
      parent_id: 14
    }, {
      id: 217,
      name: '泉州',
      parent_id: 14
    }, {
      id: 218,
      name: '漳州',
      parent_id: 14
    }, {
      id: 219,
      name: '南平',
      parent_id: 14
    }, {
      id: 220,
      name: '龙岩',
      parent_id: 14
    }, {
      id: 221,
      name: '宁德',
      parent_id: 14
    }, {
      id: 222,
      name: '其它',
      parent_id: 14
    }, {
      id: 223,
      name: '南昌',
      parent_id: 15
    }, {
      id: 224,
      name: '景德镇',
      parent_id: 15
    }, {
      id: 225,
      name: '萍乡',
      parent_id: 15
    }, {
      id: 226,
      name: '九江',
      parent_id: 15
    }, {
      id: 227,
      name: '新余',
      parent_id: 15
    }, {
      id: 228,
      name: '鹰潭',
      parent_id: 15
    }, {
      id: 229,
      name: '赣州',
      parent_id: 15
    }, {
      id: 230,
      name: '吉安',
      parent_id: 15
    }, {
      id: 231,
      name: '宜春',
      parent_id: 15
    }, {
      id: 232,
      name: '抚州',
      parent_id: 15
    }, {
      id: 233,
      name: '上饶',
      parent_id: 15
    }, {
      id: 234,
      name: '其它',
      parent_id: 15
    }, {
      id: 235,
      name: '济南',
      parent_id: 16
    }, {
      id: 236,
      name: '青岛',
      parent_id: 16
    }, {
      id: 237,
      name: '淄博',
      parent_id: 16
    }, {
      id: 238,
      name: '枣庄',
      parent_id: 16
    }, {
      id: 239,
      name: '东营',
      parent_id: 16
    }, {
      id: 240,
      name: '烟台',
      parent_id: 16
    }, {
      id: 241,
      name: '潍坊',
      parent_id: 16
    }, {
      id: 242,
      name: '济宁',
      parent_id: 16
    }, {
      id: 243,
      name: '泰安',
      parent_id: 16
    }, {
      id: 244,
      name: '威海',
      parent_id: 16
    }, {
      id: 245,
      name: '日照',
      parent_id: 16
    }, {
      id: 246,
      name: '莱芜',
      parent_id: 16
    }, {
      id: 247,
      name: '临沂',
      parent_id: 16
    }, {
      id: 248,
      name: '德州',
      parent_id: 16
    }, {
      id: 249,
      name: '聊城',
      parent_id: 16
    }, {
      id: 250,
      name: '滨州',
      parent_id: 16
    }, {
      id: 251,
      name: '菏泽',
      parent_id: 16
    }, {
      id: 252,
      name: '其它',
      parent_id: 16
    }, {
      id: 253,
      name: '郑州',
      parent_id: 17
    }, {
      id: 254,
      name: '开封',
      parent_id: 17
    }, {
      id: 255,
      name: '洛阳',
      parent_id: 17
    }, {
      id: 256,
      name: '平顶山',
      parent_id: 17
    }, {
      id: 257,
      name: '安阳',
      parent_id: 17
    }, {
      id: 258,
      name: '鹤壁',
      parent_id: 17
    }, {
      id: 259,
      name: '新乡',
      parent_id: 17
    }, {
      id: 260,
      name: '焦作',
      parent_id: 17
    }, {
      id: 261,
      name: '濮阳',
      parent_id: 17
    }, {
      id: 262,
      name: '许昌',
      parent_id: 17
    }, {
      id: 263,
      name: '漯河',
      parent_id: 17
    }, {
      id: 264,
      name: '三门峡',
      parent_id: 17
    }, {
      id: 265,
      name: '南阳',
      parent_id: 17
    }, {
      id: 266,
      name: '商丘',
      parent_id: 17
    }, {
      id: 267,
      name: '信阳',
      parent_id: 17
    }, {
      id: 268,
      name: '周口',
      parent_id: 17
    }, {
      id: 269,
      name: '驻马店',
      parent_id: 17
    }, {
      id: 270,
      name: '其它',
      parent_id: 17
    }, {
      id: 271,
      name: '武汉',
      parent_id: 18
    }, {
      id: 272,
      name: '黄石',
      parent_id: 18
    }, {
      id: 273,
      name: '十堰',
      parent_id: 18
    }, {
      id: 274,
      name: '宜昌',
      parent_id: 18
    }, {
      id: 275,
      name: '襄樊',
      parent_id: 18
    }, {
      id: 276,
      name: '鄂州',
      parent_id: 18
    }, {
      id: 277,
      name: '荆门',
      parent_id: 18
    }, {
      id: 278,
      name: '孝感',
      parent_id: 18
    }, {
      id: 279,
      name: '荆州',
      parent_id: 18
    }, {
      id: 280,
      name: '黄冈',
      parent_id: 18
    }, {
      id: 281,
      name: '咸宁',
      parent_id: 18
    }, {
      id: 282,
      name: '随州',
      parent_id: 18
    }, {
      id: 283,
      name: '恩施',
      parent_id: 18
    }, {
      id: 284,
      name: '其它',
      parent_id: 18
    }, {
      id: 285,
      name: '长沙',
      parent_id: 19
    }, {
      id: 286,
      name: '株洲',
      parent_id: 19
    }, {
      id: 287,
      name: '湘潭',
      parent_id: 19
    }, {
      id: 288,
      name: '衡阳',
      parent_id: 19
    }, {
      id: 289,
      name: '邵阳',
      parent_id: 19
    }, {
      id: 290,
      name: '岳阳',
      parent_id: 19
    }, {
      id: 291,
      name: '常德',
      parent_id: 19
    }, {
      id: 292,
      name: '张家界',
      parent_id: 19
    }, {
      id: 293,
      name: '益阳',
      parent_id: 19
    }, {
      id: 294,
      name: '郴州',
      parent_id: 19
    }, {
      id: 295,
      name: '永州',
      parent_id: 19
    }, {
      id: 296,
      name: '怀化',
      parent_id: 19
    }, {
      id: 297,
      name: '娄底',
      parent_id: 19
    }, {
      id: 298,
      name: '湘西',
      parent_id: 19
    }, {
      id: 299,
      name: '其它',
      parent_id: 19
    }, {
      id: 300,
      name: '广州',
      parent_id: 20
    }, {
      id: 301,
      name: '韶关',
      parent_id: 20
    }, {
      id: 302,
      name: '深圳',
      parent_id: 20
    }, {
      id: 303,
      name: '珠海',
      parent_id: 20
    }, {
      id: 304,
      name: '汕头',
      parent_id: 20
    }, {
      id: 305,
      name: '佛山',
      parent_id: 20
    }, {
      id: 306,
      name: '江门',
      parent_id: 20
    }, {
      id: 307,
      name: '湛江',
      parent_id: 20
    }, {
      id: 308,
      name: '茂名',
      parent_id: 20
    }, {
      id: 309,
      name: '肇庆',
      parent_id: 20
    }, {
      id: 310,
      name: '惠州',
      parent_id: 20
    }, {
      id: 311,
      name: '梅州',
      parent_id: 20
    }, {
      id: 312,
      name: '汕尾',
      parent_id: 20
    }, {
      id: 313,
      name: '河源',
      parent_id: 20
    }, {
      id: 314,
      name: '阳江',
      parent_id: 20
    }, {
      id: 315,
      name: '清远',
      parent_id: 20
    }, {
      id: 316,
      name: '东莞',
      parent_id: 20
    }, {
      id: 317,
      name: '中山',
      parent_id: 20
    }, {
      id: 318,
      name: '潮州',
      parent_id: 20
    }, {
      id: 319,
      name: '揭阳',
      parent_id: 20
    }, {
      id: 320,
      name: '云浮',
      parent_id: 20
    }, {
      id: 321,
      name: '其它',
      parent_id: 20
    }, {
      id: 322,
      name: '南宁',
      parent_id: 21
    }, {
      id: 323,
      name: '柳州',
      parent_id: 21
    }, {
      id: 324,
      name: '桂林',
      parent_id: 21
    }, {
      id: 325,
      name: '梧州',
      parent_id: 21
    }, {
      id: 326,
      name: '北海',
      parent_id: 21
    }, {
      id: 327,
      name: '钦州',
      parent_id: 21
    }, {
      id: 328,
      name: '贵港',
      parent_id: 21
    }, {
      id: 329,
      name: '玉林',
      parent_id: 21
    }, {
      id: 330,
      name: '百色',
      parent_id: 21
    }, {
      id: 331,
      name: '贺州',
      parent_id: 21
    }, {
      id: 332,
      name: '河池',
      parent_id: 21
    }, {
      id: 333,
      name: '来宾',
      parent_id: 21
    }, {
      id: 334,
      name: '崇左',
      parent_id: 21
    }, {
      id: 335,
      name: '其它',
      parent_id: 21
    }, {
      id: 336,
      name: '海口',
      parent_id: 22
    }, {
      id: 337,
      name: '三亚',
      parent_id: 22
    }, {
      id: 338,
      name: '其它',
      parent_id: 22
    }, {
      id: 339,
      name: '渝中',
      parent_id: 23
    }, {
      id: 340,
      name: '江北',
      parent_id: 23
    }, {
      id: 341,
      name: '沙坪坝',
      parent_id: 23
    }, {
      id: 342,
      name: '南岸',
      parent_id: 23
    }, {
      id: 343,
      name: '九龙坡',
      parent_id: 23
    }, {
      id: 344,
      name: '大渡口',
      parent_id: 23
    }, {
      id: 345,
      name: '江津区',
      parent_id: 23
    }, {
      id: 346,
      name: '永川区',
      parent_id: 23
    }, {
      id: 347,
      name: '黔江',
      parent_id: 23
    }, {
      id: 348,
      name: '北碚区',
      parent_id: 23
    }, {
      id: 349,
      name: '万盛区',
      parent_id: 23
    }, {
      id: 350,
      name: '渝北区',
      parent_id: 23
    }, {
      id: 351,
      name: '巴南区',
      parent_id: 23
    }, {
      id: 352,
      name: '万州区',
      parent_id: 23
    }, {
      id: 353,
      name: '涪陵区',
      parent_id: 23
    }, {
      id: 354,
      name: '长寿区',
      parent_id: 23
    }, {
      id: 355,
      name: '合川区',
      parent_id: 23
    }, {
      id: 356,
      name: '南川区',
      parent_id: 23
    }, {
      id: 357,
      name: '潼南县',
      parent_id: 23
    }, {
      id: 358,
      name: '铜梁县',
      parent_id: 23
    }, {
      id: 359,
      name: '大足县',
      parent_id: 23
    }, {
      id: 360,
      name: '荣昌县',
      parent_id: 23
    }, {
      id: 361,
      name: '璧山县',
      parent_id: 23
    }, {
      id: 362,
      name: '垫江县',
      parent_id: 23
    }, {
      id: 363,
      name: '梁平县',
      parent_id: 23
    }, {
      id: 364,
      name: '云阳县',
      parent_id: 23
    }, {
      id: 365,
      name: '酉阳',
      parent_id: 23
    }, {
      id: 366,
      name: '成都',
      parent_id: 24
    }, {
      id: 367,
      name: '自贡',
      parent_id: 24
    }, {
      id: 368,
      name: '攀枝花',
      parent_id: 24
    }, {
      id: 369,
      name: '泸州',
      parent_id: 24
    }, {
      id: 370,
      name: '德阳',
      parent_id: 24
    }, {
      id: 371,
      name: '绵阳',
      parent_id: 24
    }, {
      id: 372,
      name: '广元',
      parent_id: 24
    }, {
      id: 373,
      name: '遂宁',
      parent_id: 24
    }, {
      id: 374,
      name: '内江',
      parent_id: 24
    }, {
      id: 375,
      name: '乐山',
      parent_id: 24
    }, {
      id: 376,
      name: '南充',
      parent_id: 24
    }, {
      id: 377,
      name: '眉山',
      parent_id: 24
    }, {
      id: 378,
      name: '宜宾',
      parent_id: 24
    }, {
      id: 379,
      name: '广安',
      parent_id: 24
    }, {
      id: 380,
      name: '达州',
      parent_id: 24
    }, {
      id: 381,
      name: '雅安',
      parent_id: 24
    }, {
      id: 382,
      name: '巴中',
      parent_id: 24
    }, {
      id: 383,
      name: '资阳',
      parent_id: 24
    }, {
      id: 384,
      name: '凉山彝族',
      parent_id: 24
    }, {
      id: 385,
      name: '其它',
      parent_id: 24
    }, {
      id: 386,
      name: '贵阳',
      parent_id: 25
    }, {
      id: 387,
      name: '六盘水',
      parent_id: 25
    }, {
      id: 388,
      name: '遵义',
      parent_id: 25
    }, {
      id: 389,
      name: '安顺',
      parent_id: 25
    }, {
      id: 390,
      name: '铜仁',
      parent_id: 25
    }, {
      id: 391,
      name: '黔西南',
      parent_id: 25
    }, {
      id: 392,
      name: '毕节',
      parent_id: 25
    }, {
      id: 393,
      name: '黔东',
      parent_id: 25
    }, {
      id: 394,
      name: '黔南',
      parent_id: 25
    }, {
      id: 395,
      name: '其它',
      parent_id: 25
    }, {
      id: 396,
      name: '昆明',
      parent_id: 26
    }, {
      id: 397,
      name: '曲靖',
      parent_id: 26
    }, {
      id: 398,
      name: '玉溪',
      parent_id: 26
    }, {
      id: 399,
      name: '保山',
      parent_id: 26
    }, {
      id: 400,
      name: '昭通',
      parent_id: 26
    }, {
      id: 401,
      name: '丽江',
      parent_id: 26
    }, {
      id: 402,
      name: '临沧',
      parent_id: 26
    }, {
      id: 403,
      name: '楚雄彝族',
      parent_id: 26
    }, {
      id: 404,
      name: '红河',
      parent_id: 26
    }, {
      id: 405,
      name: '文山',
      parent_id: 26
    }, {
      id: 406,
      name: '西双版',
      parent_id: 26
    }, {
      id: 407,
      name: '大理',
      parent_id: 26
    }, {
      id: 408,
      name: '怒江',
      parent_id: 26
    }, {
      id: 409,
      name: '其它',
      parent_id: 26
    }, {
      id: 410,
      name: '拉萨',
      parent_id: 27
    }, {
      id: 411,
      name: '西安',
      parent_id: 28
    }, {
      id: 412,
      name: '铜川',
      parent_id: 28
    }, {
      id: 413,
      name: '宝鸡',
      parent_id: 28
    }, {
      id: 414,
      name: '咸阳',
      parent_id: 28
    }, {
      id: 415,
      name: '渭南',
      parent_id: 28
    }, {
      id: 416,
      name: '延安',
      parent_id: 28
    }, {
      id: 417,
      name: '汉中',
      parent_id: 28
    }, {
      id: 418,
      name: '榆林',
      parent_id: 28
    }, {
      id: 419,
      name: '安康',
      parent_id: 28
    }, {
      id: 420,
      name: '商洛',
      parent_id: 28
    }, {
      id: 421,
      name: '其它',
      parent_id: 28
    }, {
      id: 422,
      name: '兰州',
      parent_id: 29
    }, {
      id: 423,
      name: '嘉峪关',
      parent_id: 29
    }, {
      id: 424,
      name: '白银',
      parent_id: 29
    }, {
      id: 425,
      name: '天水',
      parent_id: 29
    }, {
      id: 426,
      name: '武威',
      parent_id: 29
    }, {
      id: 427,
      name: '张掖',
      parent_id: 29
    }, {
      id: 428,
      name: '平凉',
      parent_id: 29
    }, {
      id: 429,
      name: '酒泉',
      parent_id: 29
    }, {
      id: 430,
      name: '庆阳',
      parent_id: 29
    }, {
      id: 431,
      name: '定西',
      parent_id: 29
    }, {
      id: 432,
      name: '陇南',
      parent_id: 29
    }, {
      id: 433,
      name: '临夏',
      parent_id: 29
    }, {
      id: 434,
      name: '西宁',
      parent_id: 30
    }, {
      id: 435,
      name: '海西',
      parent_id: 30
    }, {
      id: 436,
      name: '银川',
      parent_id: 31
    }, {
      id: 437,
      name: '石嘴山',
      parent_id: 31
    }, {
      id: 438,
      name: '中卫',
      parent_id: 31
    }, {
      id: 439,
      name: '乌鲁木齐',
      parent_id: 32
    }, {
      id: 440,
      name: '克拉玛依',
      parent_id: 32
    }, {
      id: 441,
      name: '石河子',
      parent_id: 32
    }, {
      id: 442,
      name: '昌吉',
      parent_id: 32
    }, {
      id: 443,
      name: '巴音郭楞',
      parent_id: 32
    }, {
      id: 444,
      name: '阿克苏',
      parent_id: 32
    }, {
      id: 445,
      name: '喀什',
      parent_id: 32
    }, {
      id: 446,
      name: '和田',
      parent_id: 32
    }, {
      id: 447,
      name: '伊犁',
      parent_id: 32
    }, {
      id: 448,
      name: '阿勒泰',
      parent_id: 32
    }, {
      id: 449,
      name: '其它',
      parent_id: 32
    }, {
      id: 450,
      name: '台湾',
      parent_id: 33
    }, {
      id: 451,
      name: '香港',
      parent_id: 34
    }, {
      id: 452,
      name: '澳门',
      parent_id: 35
    }, {
      id: 453,
      name: '日本',
      parent_id: 36
    }, {
      id: 454,
      name: '新加坡',
      parent_id: 36
    }, {
      id: 455,
      name: '马来西亚',
      parent_id: 36
    }, {
      id: 456,
      name: '越南',
      parent_id: 36
    }, {
      id: 457,
      name: '阿联酋',
      parent_id: 36
    }, {
      id: 458,
      name: '法国',
      parent_id: 37
    }, {
      id: 459,
      name: '德国',
      parent_id: 37
    }, {
      id: 460,
      name: '西班牙',
      parent_id: 37
    }, {
      id: 461,
      name: '美国',
      parent_id: 38
    }, {
      id: 462,
      name: '加拿大',
      parent_id: 38
    }, {
      id: 463,
      name: '巴西',
      parent_id: 38
    }, {
      id: 464,
      name: '澳大利亚',
      parent_id: 39
    }, {
      id: 465,
      name: '新西兰',
      parent_id: 39
    }];
    return {
      first: true,
      currProvince: this.province,
      currCity: this.city,
      provinces: this.areas.filter(d => d.parent_id === 0),
      citys: this.areas.filter(d => d.parent_id === this.province)
    };
  },
  watch: {
    'province'(val, oldValue) {
      this.currProvince = val;
    },
    'city'(val, oldValue) {
      this.currCity = val;
    }
  },
  methods: {
    changeProvince() {
      this.citys = this.areas.filter(d => d.parent_id === this.currProvince);
      if(this.first) {
        this.first = false;
      }else {
        this.currCity = '';
      }
      this.$emit('setProvince',this.currProvince);
    },
    changeCity() {
      this.$emit('setCity',this.currCity);
    }
  }
};
</script>
